#include <iostream>
using namespace std;

const int CUSTOM_SIZE = 120;

class MyStack {
	private:
		int stackData[CUSTOM_SIZE];
		int stackTopIndex;
	public:
		MyStack() {
			stackTopIndex = -1;
		}

		bool isEmptyStack() {
			return stackTopIndex == -1;
		}

		bool isFullStack() {
			return stackTopIndex == CUSTOM_SIZE - 1;
		}

		void addElement(int itemValue) {
			if (isFullStack()) {
				cout << "The stack is full. Cannot add more elements." << endl;
			} else {
				stackData[++stackTopIndex] = itemValue;
			}
		}

		int removeElement() {
			if (isEmptyStack()) {
				cout << "The stack is empty. Cannot remove elements." << endl;
				return -1;
			} else {
				return stackData[stackTopIndex--];
			}
		}

		int topElement() {
			if (isEmptyStack()) {
				cout << "The stack is empty. No top element." << endl;
				return -1;
			} else {
				return stackData[stackTopIndex];
			}
		}
};

int main() {
	MyStack myStackObj;
	myStackObj.addElement(15);
	myStackObj.addElement(25);
	myStackObj.addElement(35);

	cout << "Top element: " << myStackObj.topElement() << endl;
	cout << "Popped element: " << myStackObj.removeElement() << endl;
	cout << "Top element after pop: " << myStackObj.topElement() << endl;

	return 0;
}